import { defineStore } from 'pinia'
import { ref } from 'vue'
export const useToken = defineStore(
  'token',
  () => {
    const token = ref(null)
    const setToken = (value) => {
      token.value = value
    }
    const getToken = () => token.value
    const removeToken = () => (token.value = null)
    return { token, setToken, getToken, removeToken }
  },
  {
    persist: true // 持久化标记
  }
)
